﻿using UnityEngine;
using System.Collections;

public class Player : Actor
{
    public float speed;
    public float bulletDelay;
    public Guns[] guns;
	public Guns trigger;
    private Vector3 currentRotation;
    private Quaternion originalRotation;
    private int shootingCount = 0;
    private float currentTimer = 0;
	public PlayerHealth playerHealth;
	private void Awake()
	{
        originalRotation = transform.rotation;
        currentRotation = Vector3.zero;
	}

	private void Update () 
	{
		if (Input.GetMouseButtonDown (0))
		{
			trigger.Shoot ();
			Debug.Log("shoot");
		}
       
	}
	
}
//transform
//gameObject
//renderer
//rigidbody

//Vector3 dir = new Vector3( 
//    (Input.GetKey(KeyCode.S)? -1 : 0) + (Input.GetKey(KeyCode.W)? 1 : 0),
//    0,
//    (Input.GetKey(KeyCode.D)? -1 : 0) + (Input.GetKey(KeyCode.A)? 1 : 0)
//);

//currentTimer += Time.deltaTime;

/* if (Input.GetKey(KeyCode.Space))
        {
            if (currentTimer >= bulletDelay)
            {
                Guns[shootingCount % 2].Shoot();
                currentTimer = 0;
                shootingCount++;
            }
        }*/

//Vector3 dir = new Vector3(Input.GetAxis("Vertical"), 0.0f, Input.GetAxis("Horizontal"));
//currentRotation += dir;
//
//// Attention! le modele est mal orienté -up est le forward.
//transform.position += -transform.up * speed * Time.deltaTime;
//transform.rotation = originalRotation * Quaternion.Euler(currentRotation);